package com.cpe.data.domain.student.physique;

import java.util.Date;

import lombok.Data;

/**
 * 学生体质成绩信息
 */
@Data
public class StudentPhysiqueInfo {

	private String id;

	private String studentId;

	private String studentName;

	private Date birthday;

	private Integer sex;

	private String physiqueName;

	private Date scoreDate;

	private Float score;

	private Integer lowOrHigh;

	private String className;

	private String parentId;

	private Integer value;

	private String unit;

	private String scoreInfo;

	private boolean showDetail;

	public String getScoreInfo() {
		if ("体型".equals(physiqueName)) {
			if (lowOrHigh == 2) {
				scoreInfo = "正常";
			} else if (lowOrHigh == 0) {
				scoreInfo = "偏瘦";
			} else if (lowOrHigh == 1) {
				scoreInfo = "偏胖";
			}
		} else {
			scoreInfo = unit == null ? score + "" : score + unit;
		}
		return scoreInfo;
	}

	public boolean isShowDetail() {
		this.showDetail = !("体重".equals(physiqueName) || "身高".equals(physiqueName));
		return showDetail;
	}
}
